package ink.yql.dao;

import ink.yql.model.Project;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author YQL
 */
@Mapper
public interface ProjectDao {
    // 由projectdao来实现sql
    List<Project> getByStatus(@Param("lable") String lable,
                              @Param("pstatus") Integer pstatus,
                              @Param("orderBy") String orderBy);

    @Select("select * from project where pid = #{pid} ")
    Project getByPid(@Param("pid") Integer pid);
    @Insert("insert into project (ptitle,psmallTitle,,psummary,plabel,pprovince,pcity,pstartTime,pendTime,ptargetMoney,pdetail,pstatus)VALUES " +
              "(#{ptitle},#{psmallTitle},#{psummary} ,#{plabel},#{pprovince}  ,#{pcity}m,#{pstartTime},#{pendTime} ,#{ptargetMoney} ,#{pdetail} ,#{pstatus}  )")
    Integer addOne(Project project);
    @Update("Update project (ptitle,psmallTitle,,psummary,plabel,pprovince,pcity,pstartTime,pendTime,ptargetMoney,pdetail,pstatus)VALUES " +
              "(#{ptitle},#{psmallTitle},#{psummary} ,#{plabel},#{pprovince}  ,#{pcity}m,#{pstartTime},#{pendTime} ,#{ptargetMoney} ,#{pdetail} ,#{pstatus}  ) where pid = #{pid}")
    Integer update(Project project);
}
